home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2004 E…tra 100 Bedste Programmer / K-CD_2004_Ekstra_100_Gratis_Programmer.iso / Windows / X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ NoOpen Files Add.xpl < prev    next >
Encoding:
XSetup plugin  |  2004-05-19  |  2.6 KB  |  70 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="5"
  3. "COUNT"="1"
  4. "UIPATH"="Appearance\Files&Folders\Files Open Warning"
  5. "NAME"="Add File Open Warning"
  6. "VERSION"="1.52"
  7. "LANGUAGE"="VBScript"
  8. "OSVERSION"="0001011"
  9. "TEXT 1"="Add new file to the File Open Warning list"
  10. "DESCRIPTION 1"="This plug-in allows you to add a new file type that currently does not have an open warning. After adding it, you can change the Open Warning with the "Edit File Open Warnings" plug-in."
  11. "DESCRIPTION 2"="Please note that this will ONLY work for file types not associated with an application, for example TXT files will NOT work since they are associated with Notepad by default."
  12. "AUTHOR"="Xteq Systems"
  13. "CONTACTURL"="http://www.xteq.com"
  14. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  15. "COMMENT 1"="Thanks to eric for the bug report!"
  16.  
  17. sP_UnknownFile="HKCR\Unknown\Shell\Open\Command\@"
  18. sText_UnknownFile="You have set a command for unknown files. This means, there is a command in your registry that allows you to open any file even if the file type is unknown. Having this function activated, prevents the file warnings from appearing. Please deactivate the Unknown File command using the plugin and return to this plugin." 
  19.  
  20. sP="HKLM\Software\Classes\"
  21.  
  22.  
  23. Sub Plugin_Initialize 
  24.  'check for unknown command!
  25.  sUNK_Check=RegReadValue(sP_UnknownFile)
  26.  if len(sUNK_Check)>0 then
  27.     Call MsgWarning(sText_UnknownFile)
  28.     Call Disable   
  29.  end if
  30.  
  31. End Sub
  32.  
  33. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  34.     if ElementIndex=1 then
  35.        s=InputWindow("Please enter the extension of the file type, without the beginning dot, e.g. PIP instead of .PIP","PIP",1) 
  36.        if IsEmpty(s)=false then
  37.           'first try to get the normal path
  38.           sPath=sP & "." & s
  39.          
  40.           'check if the @ value is empty or not
  41.           sVal=RegReadValue(sPath & "\@")
  42.           if len(sVal)>0 then
  43.              'we have a value name that means, we need to dive further into the registry
  44.              sPath=sP & sVal
  45.           end if
  46.  
  47.           'now check if there is a shell or shell ex folder
  48.           
  49.           if RegPathExists(sPath & "\shell")=false and RegPathExists(sPath & "\shellex")=false then
  50.              if RegValueExists(sPath & "\NoOpen") then
  51.                 Call MsgError("Sorry, this file type has already an open warning")
  52.              else
  53.                 Call RegWriteValue(sPath & "\NoOpen","",1)
  54.              end if      
  55.           else
  56.              Call MsgError("Sorry, this file is associated with an application")
  57.           end if
  58.         
  59.  
  60.        end if
  61.     end if
  62.  
  63. End Sub
  64.  
  65.  
  66.  
  67.  
  68. Sub Plugin_Terminate 
  69. End Sub
  70.